<template>
  <BaseContainer>
    <aplid-base-crud ref="crud" class="w-100"  v-bind="{...baseConfig,...$attrs }" >
      <template v-slot:ArchivesDialog="{ row, show }" >
        <Archives @refresh="handleRefresh" @refreshPage="handleRefreshPage" @rechange="handleOperate"
          :api="baseConfig.api" :key="show" :nowRowData="row"></Archives>
      </template>
    </aplid-base-crud>
  </BaseContainer>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import {baseConfig} from './serviceOrgConfig'
import Archives from '@/views/datacenter/basicData/serviceOrg/components/Archives/index.vue'


const crud = ref()
const dialogVisible = ref(false)
const handleRefresh = (query, visible = false) => {
  dialogVisible.value = visible
  nextTick(() => {
    crud.value.refreshChange(query)
  })
}
const handleOperate = (type, row, title) => {
  nextTick(() => {
    crud.value.handleOperate(type, row, title)
  })
}
const handleRefreshPage = () => {
  nextTick(() => {
    crud.value.refreshChange({}, true)
  })
}
// const judgeHavePerson = async(row) =>{
//   let checked: boolean
//   const checkFilter = row.filter(item => item.id === row.id)
//   if (checkFilter.length > 0) {
//     checked = true
//   } else {
//     checked = false
//   }
//   console.log('勾选22',a)
// 	const params = {
//       occupationType: 6,
//       creditCode: row[row.length-1].creditCode,
//       pageParaPO: {
//         size: 10,
//         current: 1
//       }
//     }
//     const res = await apiMod.view_dpFoundationPractitioners_page(params)
//     if(res.data.records.length == 0){
//       ElMessage.warning('该机构下没有从业人员')
//     }
// }
</script>

<style scoped></style>
